<%@ page language="java" pageEncoding="utf-8"
         contentType="text/html;charset=utf-8" %>
<html>

<%@ include file="../../common/jstl.jsp" %>

<script type="text/javascript">

    var parentChosen;



    //表单验证
    $(function () {
        /*	parentChosen = $(".chosen-select").chosen({
                no_results_text: "未找到父菜单",
                width : '100%'
            });*/

        $('#editForm').validator({
            ignore: ':hidden',
            fields: {
                name: '名称:required;length[~20]',
                orderNo: '序号:integer[+]',
                type: '类型:required;',
                parentId: '父菜单:required;'
            },
            valid: function (form) {
                //联系人
                var linkman = document.getElementById("linkman").value;
                if (linkman.length == 0) {
                    alert("请输入联系人!!");
                    return;
                }
                //联系电话
                var phone = document.getElementById("phone").value;
                if (phone.length == 0) {
                    alert("请输入联系电话");
                    return;
                }
                var laodIdx = layer.load();
                $('#editForm').ajaxSubmit({
                    data: {},
                    traditional: true,
                    success: function (result) {
                        layer.close(laodIdx);
                        if (result.success) {
                            layer.alert('操作成功', function () {
                                window.location.reload();
                            });
                        } else {
                            layer.alert(result.msg);
                        }
                    }
                });
            }
        });
        /*$('input[name="type"]').on('click', function(){
            var val = $('input[name="type"]:checked').val();
            if(val == 'page'){
                $('#parentMenuSelect').show();
            }else{
                $('#parentMenuSelect').hide();
            }
        });*/

    });


</script>

<head>
</head>

<body>


<div id="addForm" class="mgt40">
    <form action="${ctx }/member/addMemberOf" id="editForm" method="post">
        <input type="hidden" name="id" value="${memberOf.id }"/>
        <div class="">
            <div class="J_formTable l_form_table">
                <table class="not_hightlight">
                    <tr>
                        <td class="l_title w200"> 公司名称</td>
                        <td>
                            <div class="J_toolsBar fl">
                                <div class="t_text w200 ml10">
                                    <input type="text" name="companyName" value="${memberOf.companyName }"
                                           maxlength="20"/>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="l_title "><b class="cRed">*</b> 联系人</td>
                        <td>
                            <div class="J_toolsBar fl">
                                <div class="t_text w200 ml10">
                                    <label>
                                        <input type="text" name="linkman" id="linkman" value="${memberOf.linkman }" maxlength="20"/>
                                    </label>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="l_title "><b class="cRed">*</b> 联系电话</td>
                        <td>
                            <div class="J_toolsBar fl">
                                <div class="t_text w200 ml10">
                                    <label>
                                        <input type="text" id="phone" name="phone"
                                               value="${memberOf.phone }" maxlength="11"/>
                                    </label>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="l_title "> 会费缴纳</td>
                        <td>
                            <div class="J_toolsBar fl">
                                <div class="t_text w200 ml10">
                                    <label>
                                        <input type="text" name="money" value="${memberOf.money }" maxlength="9"/>
                                    </label>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="l_title "> 地区</td>
                        <td>
                            <div class="J_toolsBar fl">
                                <div class="t_text w200 ml10">
                                    <label>
                                        <input type="text" name="areaId" value="${memberOf.areaId }" maxlength="9"/>
                                    </label>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="l_title "> 邮箱</td>
                        <td>
                            <div class="J_toolsBar fl">
                                <div class="t_text w200 ml10">
                                    <label>
                                        <input type="text" name="eMail" value="${memberOf.eMail }" maxlength="30"/>
                                    </label>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="l_title "><b class="cRed">*</b> 是否封存</td>
                        <td>
                            <div class="J_toolsBar fl">
                                <div class="t_check w200 ml10">
                                    <label>
                                        <input type="radio" name="deleteFlag" value="1"/>是
                                    </label>
                                    <label>
                                        <input type="radio" name="deleteFlag" value="0" checked="checked"/>否
                                    </label>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr id="parentMenuSelect">
                        <td class="l_title "><b class="cRed">*</b> 理事会员职务</td>
                        <td>
                            <div class="J_toolsBar fl">
                                <div class="t_label ml10" style="width: 220px;">
                                    <select data-placeholder="选择职务" class="chosen-select" name="memberType">
                                        <option value="0" selected>常务副会长</option>
                                        <option value="1">副会长</option>
                                        <option value="2">常务理事</option>
                                        <option value="3">理事</option>
                                        <option value="4">集体会员</option>
                                        <option value="5">个人会员</option>
                                    </select>
                                </div>
                            </div>
                        </td>
                    </tr>

                </table>
            </div>
        </div>
    </form>
</div>

</body>
</html>